<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
	<title>
		<?php __('QuizGame'); ?>
		<?php echo $title_for_layout; ?>
	</title>
	<?php
		echo $this->Html->meta('icon');
		echo $this->Html->css('cake.generic');

		echo $this->Html->script('jsjquery-1.6');

		echo $scripts_for_layout;
	?>
</head>
<body>
	<div id="container">
		<div id="header">
			<div id="logo">
			<?php echo $this->Html->image('QuizFrame.png', array('alt'=> __('QuizFrame: El juego de los fotogramas.', true), 'border' => '0')); ?>
			</div>

			<?php if ($this->Session->check('Auth.User')): ?>
			<ul id="menu">
				<li><?php echo $this->Html->link('Inicio', '/'); ?></li>
				<li><?php echo $this->Html->link('Play', array('controller' => 'games', 'action' => 'start', 'admin' => false)); ?></li>
				<li><?php echo $this->Html->link('Profile', array('controller' => 'users', 'action' => 'index', 'admin' => false)); ?></li>
				<li><?php echo $this->Html->link('Frames', array('controller' => 'frames', 'action' => 'admin_index', 'admin' => true)); ?></li>
				<li><?php echo $this->Html->link('Logout', array('controller' => 'users', 'action' => 'logout', 'admin' => false)); ?></li>
			</ul>
			<?php else: ?>
			<ul id="menu">
				<li><?php echo $this->Html->link('Inicio', '/'); ?></li>
				<li><?php echo $this->Html->link('Play', array('controller' => 'games', 'action' => 'start', 'admin' => false)); ?></li>
				<li><?php echo $this->Html->link('Login', array('controller' => 'users', 'action' => 'login')); ?></li>
			</ul>
			<?php endif; ?>
			
		</div>
		<div id="content">

			<?php echo $this->Session->flash(); ?>

			<?php echo $content_for_layout; ?>

		</div><!-- content -->
		<div id="footer">
			<?php echo $this->Html->link(
					$this->Html->image('cake.power.gif', array('alt'=> __('CakePHP: the rapid development php framework', true), 'border' => '0')),
					'http://www.cakephp.org/',
					array('target' => '_blank', 'escape' => false)
				);
			?>
		</div>
	</div>
	<?php 
		echo $this->element('sql_dump'); 
		echo $this->Js->writeBuffer(); // Write cached scripts
	?>
</body>
</html>